
import axios from 'axios'

const url = '/webArticles'

export function submitArticle (title, author, region, content, token) {
  const data = {
    title,
    author,
    region,
    content
  }

  return axios({
    method: 'POST',
    url,
    headers: {
      Authorization: `Bearer ${token}\n`
    },
    data
  }).then((res) => {
    return Promise.resolve(res.data)
  }).catch((err) => {
    return Promise.reject(err)
  })
}
